﻿/* ----------------------------------------------------------------------------
 * Copyright (c) Philip Stears 
 *
 * This source code is subject to terms and conditions of the Microsoft Public 
 * License (Ms-PL).
 * 
 * By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 * 
 * To request a copy of the Microsoft Public License, send a request by email
 * to license@connectbasic.net.
 *
 * This notice must not be removed from this software.
 * ---------------------------------------------------------------------------- */

namespace ConnectBasic.Shell.Extensibility
{
    using System.Collections.Generic;

    /// <summary>
    /// Represents a collection of tool window zones.
    /// </summary>
    public interface IToolWindowZoneCollection : IEnumerable<IToolWindowZone>
    {

        /// <summary>
        /// Attaches the given window to the given zone
        /// for the given state.
        /// </summary>
        /// <param name="zone">The zone to which to attach the window.</param>
        /// <param name="state">The state in which the window should be attached to the zone.</param>
        /// <param name="window">The window to attach.</param>
        void AttachWindow(IToolWindowZone zone, IShellState state, IToolWindow window);

        /// <summary>
        /// Gets the windows attached to the given zone in the given state.
        /// </summary>
        /// <param name="zone">The zone.</param>
        /// <param name="state">The state in which the windows are attached to the zone.</param>
        /// <returns></returns>
        IEnumerable<IToolWindow> GetAttachedWindows(IToolWindowZone zone, IShellState state);

        /// <summary>
        /// Gets the tool window zone at the given index.
        /// </summary>
        /// <param name="index">The index of the tool window zone to get.</param>
        /// <returns></returns>
        IToolWindowZone this[int index] { get; }

        /// <summary>
        /// Gets the tool window zone with the given name.
        /// </summary>
        /// <param name="invariantName">The invariant name of the tool window zone to get.</param>
        /// <returns></returns>
        IToolWindowZone this[string invariantName] { get; }

        /// <summary>
        /// Gets the number of tool window zones in the collection.
        /// </summary>
        int Count { get; }
    }
}
